Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replaced useDispatch with useQuery #6329

Closed
wants to merge 1 commit into from
Closed

replaced useDispatch with useQuery #6329

wants to merge 1 commit into from

Conversation

AlexVCS
Copy link

@AlexVCS AlexVCS commented Sep 22, 2023

WHAT

replaced useDispatch with useQuery in (src/Components/DeathReport/**)

Proposed Changes

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

HOW

🤖 Generated by Copilot at d06f732

  • Replace useDispatch hook with useQuery hook to fetch patient data from API (link)
  • Import useQuery hook from Utils/request module (link)

@AlexVCS AlexVCS requested a review from a team September 22, 2023 15:24
@AlexVCS AlexVCS requested a review from a team as a code owner September 22, 2023 15:24
@AlexVCS AlexVCS requested a review from vigneshhari September 22, 2023 15:24
@vercel
Copy link

vercel bot commented Sep 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 22, 2023 3:24pm

@netlify
Copy link

netlify bot commented Sep 22, 2023

Deploy Preview for care-egov-staging failed.

Name Link
🔨 Latest commit d06f732
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/650db1a832066d0007ce5199

@netlify
Copy link

netlify bot commented Sep 22, 2023

Deploy Preview for care-net failed.

Name Link
🔨 Latest commit d06f732
🔍 Latest deploy log https://app.netlify.com/sites/care-net/deploys/650db1a834ad1900087524f5

@github-actions github-actions bot added the Deploy-Failed Deplyment is not showing preview label Sep 22, 2023
Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @AlexVCS, you may refer #6316 on how to perform the replacement properly. This is not a plug-and-play replacement.

@AlexVCS
Copy link
Author

AlexVCS commented Sep 22, 2023

Hey @AlexVCS, you may refer #6316 on how to perform the replacement properly. This is not a plug-and-play replacement.

ok. I see getPatient should be available to useQuery, so don't think any are being used that can't still be used. where do I add the response types?

@rithviknishad
Copy link
Member

You can add the response types to the API route def. itself in the api.tsx file itself as mentioned in the EPIC issue linked to the issue.

You can add another key value pair, example:

getPatient: {
  path: "/api/v1/....",
  method: "GET",
  TRes: Res<PatientModel>(),
}

If PatientModel or (any other similar name) doesn't exist that defines the type for that API response, you'll have to create one. Check the README of this repo. and you'll get to see the swagger documentation.

You could use tools like https://transform.tools/json-to-typescript to convert the example response to JSON.

(Related models needs to be properly referenced to other interfaces however)

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 1, 2023
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

Hi, @gigincg, @nihal467, @khavinshankar, @mathew-alex, This pr has been automatically closed because it has not had any recent activity. Thank you for your contributions. Feel free to repopen the pr.

@github-actions github-actions bot closed this Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deploy-Failed Deplyment is not showing preview stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🛠️ Replace useDispatch w. useQuery/request: DeathReport (src/Components/DeathReport/**)
2 participants